package com.example.demo.mapper;


import com.example.demo.entiy.Article;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ArticleMapper {
    public List<Article> getArticleList();

    public Article getArticleByArticleId(Integer articleId);

    public Article getArticleCommentByArticleId(Integer articleId);

    //点击量(hits)
    public List<Article> getArticleOrderDesc();

    public int getAllArticleCount();

    //发布时间(created)
    public List<Article> getArticleOrderByCreatedDesc();

    public int insertArticleByArticle(Article article);

    public List<Article> getArticleListAndHits();

    public int deleteArticleByArticleId(Integer articleId);

    public int updateArticleByArticleId(Article article);

    public Article getArticleCategoriesByArticleId(Integer articleId);
}
